<#assign menu="system">
<#assign submenu="system_basic">
<#include "/system/head.ftl">
<!--main content start-->
<section id="main-content">
	<section class="wrapper">
    	<!-- page start-->
    	<div class="row">
		<div class="col-lg-12">
		<section class="panel">
			<header class="panel-heading">
					修改系统配置
			</header>
			<div class="panel-body">
				<form id="basicForm" action="${basePath}/admin/config/basic.json" role="form" class="form-horizontal" autocomplete="off" method="post" >
					<div class="form-group">
						<label class="col-lg-2 col-sm-2 control-label" for="inputEmail1">网站名称</label>
						<div class="col-lg-10">
							<input type="text" placeholder="网站名称" id="siteName" name="siteName"
								class="form-control" value="${SYS_SITENAME}">
						</div>
					</div>
					<div class="form-group">
						<label class="col-lg-2 col-sm-2 control-label" for="inputEmail1">网站描述</label>
						<div class="col-lg-10">
							<input type="text" placeholder="网站描述" id="siteDesc" name="siteDesc"
								class="form-control" value="${SYS_SITEDESC}">
						</div>
					</div>
					<div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">网站模板</label>
                          <div class="col-sm-10">
							<select class="form-control input-lg m-bot15" style="font-size:15px;width: 300px;" id="template" name="template">
		                   		<#list templeteList as template>
		                        	<option style="background-color:#DFF0D8;font-weight:bold;" value="${template}" <#if (THEME==template)>selected</#if>>
		                        		${template}
		                        	</option>
		                        </#list>
                            </select>                                        
                          </div>
                      </div> 
          			<div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">是否开启缓存</label>
                          <div class="col-sm-10">
                          	<label class="radio-inline">
                        		<input type="radio" name="cache" value="1" <#if (CACHE=='1')>checked</#if>/> 开启
                      		</label>
                      		<label class="radio-inline">
                        		<input type="radio" name="cache" value="0" <#if (CACHE=='0')>checked</#if>/> 关闭
                      		</label>
                      		<label class="col-lg-offset-1 ">
                      			<button class="btn btn-danger" type="button" onClick="clearHtml();">清理缓存</button>
                      		</label>
                          </div>
                      </div>
					<div class="form-group">
						<div class="col-lg-offset-2 col-lg-10">
							<button class="btn btn-danger" type="submit">保存</button>
						</div>
					</div>
				</form>
			</div>
		</section>
	</div>
	</div>
    	<!-- page end-->
     </section>
</section>
<!--main content end-->

<script type="text/javascript">
$(function() {
	$('#basicForm').ajaxForm({
		dataType : 'json',
		success : function(data) {
			if (data.result) {
				bootbox.alert("保存成功，将刷新页面", function() {
					window.location.reload();
				});					
			}else{
				showErrors($('#basicForm'),data.errors);
			}
		},
		error : function(data,textstatus){
	        bootbox.alert({  
	            buttons: {  
	               ok: {  
	                    label: '关闭'
	               }  
	            },  
	            message: data.responseText,
	            title: "错误",  
	        });
        }
	});
});
function clearHtml(){
	alert("删除html文件");
}
</script>

<#include "/system/foot.ftl">